package messagesvc.api.impl;

import cn.ucloud.microsf.commonlib.response.EmptyResponse;
import cn.ucloud.microsf.commonlib.response.PageListResponse;
import cn.ucloud.microsf.messagesvc.executor.template.TemplateCreateExecutor;
import cn.ucloud.microsf.messagesvc.executor.template.TemplateListExecutor;
import cn.ucloud.microsf.messagesvc.request.template.TemplateCreateRequest;
import cn.ucloud.microsf.messagesvc.request.template.TemplateListRequest;
import cn.ucloud.microsf.messagesvc.response.template.TemplateResponse;
import messagesvc.api.TemplateController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TemplateControllerImpl implements TemplateController {

  @Autowired
  private TemplateListExecutor templateListExecutor;
  @Autowired
  private TemplateCreateExecutor templateCreateExecutor;

  @Override
  public PageListResponse<TemplateResponse> list(TemplateListRequest request) {
    return templateListExecutor.execute(request);
  }

  @Override
  public EmptyResponse create(TemplateCreateRequest request) {
    return templateCreateExecutor.execute(request);
  }
}
